package com.siren.tank.group;

import com.siren.tank.Dir;
import com.siren.tank.Group;
import com.siren.tank.group.image.BadTank;
import com.siren.tank.group.image.GoodBullet;
import com.siren.tank.group.image.GoodExplode;
import com.siren.tank.group.image.GoodTank;

/**
 * @author : wangjichao
 * @description:
 * @date : 2020/7/29 10:30
 */
public class ImageFactory extends AbstractFactory {

    private static final ImageFactory factory = new ImageFactory();

    public static ImageFactory getInstance() {
        return factory;
    }

    private ImageFactory() {}

    @Override
    public BaseTank createGoodTank(int x, int y, Dir dir) {
        return new GoodTank(x, y, dir);
    }

    @Override
    public BaseTank createBadTank(int x, int y, Dir dir) {
        return new BadTank(x, y, dir);
    }

    @Override
    public Bullet createBullet(int x, int y, Dir dir, Group group) {
        return new GoodBullet(x, y, dir, group);
    }

    @Override
    public Explode createExplode(int x, int y) {
        return new GoodExplode(x, y);
    }

    @Override
    public Wall createWall(int beginX, int beginY, int endX, int endY) {
        return new Wall(beginX, beginY, endX, endY);
    }
}
